<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Add Gallery</title>
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
</head>
<body><form action="../rest/process/add_product" method="POST" enctype="application/x-www-form-urlencoded">
		<input style="width: 150px;" id="product_name" type="text"
			placeholder="Input New Gallery" />
		<input type="button" onclick="callAddNewGallery();"
			value="save"/>
	</form>
	<script type="text/javascript">
		function callAddNewGallery(){
			var newGalleryName = document.getElementById('product_name').value;
			newGalleryName = newGalleryName.trim();
			if(newGalleryName.length<=0){
				return false;
			}else{
				 var formdata = new FormData();
                 var xhr = new XMLHttpRequest();
                 xhr.open("POST","/rest/process/add_product",true);
                 var parameters="product_name="+newGalleryName;
                 xhr.send(parameters);
                 xhr.onload = function(e) {
                     if (this.status == 200) {
                         //alert(this.responseText);
                         fullhappy_light_box_light
                         (new HappyLightBox()).innerClose();
                     }
                 };                    
			}
				
		};
	</script>
</body>
</html>